//
//  SetDeviceOnlineRequest.m
//  TestGizWits
//
//  Created by JM on 15/11/17.
//  Copyright © 2015年 JM. All rights reserved.
//

#import "SetDeviceOnlineRequest.h"

@implementation SetDeviceOnlineRequest
- (void)requstWithCompletionHandler:(FinishLoadBlock)aBlock {
    NSAssert(0, @"不能使用");
}
- (void)didRealRequest {
    [[XPGWifiSDK sharedInstance] setDeviceWifi:self.DY_ssid key:self.DY_key mode:XPGWifiSDKAirLinkMode softAPSSIDPrefix:@"XPG-GAgent" timeout:30 wifiGAgentType:nil];//@(XPGWifiGAgentTypeHF)//这个参数 设置错误 不会有任何提示
}

//配置事件
- (void)XPGWifiSDK:(XPGWifiSDK *)wifiSDK didSetDeviceWifi:(XPGWifiDevice *)device result:(int)result {
    
    if (XPGWifiError_NOT_IN_SOFTAPMODE) {
        return;
    }
    if(result == XPGWifiError_NONE) {
        SetDeviceOnlineResponse* response = [SetDeviceOnlineResponse response];
        response.DY_wifiSDK = wifiSDK;
        response.DY_device = device;
        self.block(response,nil);
    }
    else
    {
        self.block(nil,[NSError dy_errorWithErrCode:result]);
    }
    [super superHandelResponse];

}

- (void)setDeviceWifi:(NSString*)ssid
                  key:(NSString*)key
                 mode:(XPGConfigureMode)mode
     softAPSSIDPrefix:(NSString*)softAPSSIDPrefix
              timeout:(int)timeout
       wifiGAgentType:(NSArray*)types{
    
}


@end

@implementation SetDeviceOnlineResponse
@end